import request from "@/utils/request";
import type { loginForm, loginResponseData, logoutResponseData, userResponseData } from "./type";

enum API {
  LOGIN_URL = "/admin/acl/index/login",
  LOGOUT_URL = "/admin/acl/index/logout",
  USERINFO_URL = "/admin/acl/index/info"
}
/**
 *  登录接口
 * @param data
 * @returns loginResponseData
 */
export const reqLogin = (data: loginForm) => request.post<any, loginResponseData>(API.LOGIN_URL, data);
/**
 *  登出接口
 * @param data
 * @returns logoutResponseData
 */
export const reqLogout = () => request.post<any, logoutResponseData>(API.LOGOUT_URL);
/**
 *  获取用户信息接口
 * @returns userResponseData
 */
export const reqUserInfo = () => request.get<any, userResponseData>(API.USERINFO_URL);
